package com.ruicar.afs.cloud.bizcommon.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.bizcommon.business.bean.FinanceCalculatorBean;
import com.ruicar.afs.cloud.bizcommon.business.bean.FinanceInfoBean;
import com.ruicar.afs.cloud.bizcommon.business.condition.ApplyTotalCondition;
import com.ruicar.afs.cloud.bizcommon.business.dto.CalculatorDTO;
import com.ruicar.afs.cloud.bizcommon.business.entity.FinCostDetails;

import java.math.BigDecimal;
import java.util.List;

/**
 * @description: 融资费用
 * @author: sijun.yu
 * @date: 2020/5/16 11:37
 */
public interface ApplyCostDetailsService extends IService<FinCostDetails> {

    /**
     * 获取客户利率（月） 只舍不入，保留一位小数
     * @param loanTerm
     * @param firstRent
     * @param loanAmt
     * @return
     */
    public BigDecimal getMonthlyRate(Integer loanTerm,BigDecimal firstRent,BigDecimal loanAmt);

    /**
     * 万元系数法，只舍不入，保留整数
     * @param firstRent
     * @param loanAmt
     * @return
     */
    public BigDecimal getMyriadCoefficient(BigDecimal firstRent,BigDecimal loanAmt);

    /**
     * 获取融资信息合计信息
     *
     * @param vo
     * @param condition
     */
    public void getFinanceCostTotal(FinanceCalculatorBean vo, CalculatorDTO condition);

    /**
     * 保存融资明细
     *
     * @param condition
     */
    public FinCostDetails saveApplyCostDetails(String applyNo, CalculatorDTO condition);

    /**
     * 保存或更新融资明细
     * @param applyNo
     * @param condition
     * @return
     */
    public FinCostDetails saveOrUpdateCostDetails(String applyNo, CalculatorDTO condition);

    /**
     * 更新费用信息
     *
     * @param condition
     */
    public void upateApplyCostDetails(FinCostDetails costDetails, CalculatorDTO condition);

    /**
     * 获取车辆产品信息
     *
     * @param applyNo
     * @param carId
     * @param costType
     * @return
     */
    public FinanceInfoBean getCarProductInfo(String applyNo, Long carId, String costType);

    /**
     * 获取附加贷产品信息
     *
     * @param applyNo
     * @param carId
     * @param costType
     * @return
     */
    public FinanceInfoBean getAddProductInfo(String applyNo, Long carId, String costType);

    /**
     * 通过申请编号和费用类型查询
     *
     * @param applyNo
     * @param costType
     * @return
     */
    public FinCostDetails getApplyCostDetails(String applyNo, String costType);

    /**
     * 通过申请编号、费用类型、车辆ID查询
     *
     * @param applyNo
     * @param carId
     * @param costType
     * @return
     */
    public FinCostDetails getApplyCostDetails(String applyNo, Long carId, String costType);

    /**
     * 保存融资列表信息
     *
     * @param applyNo
     * @param inList
     * @return
     */
    public List<FinCostDetails> saveCostDetailsList(String applyNo, Long carId, List<CalculatorDTO> inList);


    /**
     * 更新融资列表信息
     *
     * @param applyNo
     * @param inList
     */
    public List<FinCostDetails> updateCostDetailsList(String applyNo, Long carId, List<CalculatorDTO> inList);

    /**
     * 通过申请编号获取列表
     * @param applyNo
     * @return
     */
    public List<FinCostDetails> getCostDetailsList(String applyNo);

    /**
     * 修改车价专用
     * @param applyNo
     * @param carId
     * @param inList
     * @return
     */
    public List<FinCostDetails> updateCostDetailsForSalePrice(String applyNo, Long carId, List<CalculatorDTO> inList);

    public List<FinCostDetails>  getAllMoney(ApplyTotalCondition applyTotalCondition);

}
